package com.accp.restaurant.controller;


import com.accp.restaurant.dao.PermissionDao;
import com.accp.restaurant.entity.Permission;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/Permission")
public class PermissionController {

    @Autowired
    private PermissionDao permissionDao;

    @RequestMapping("/query")
    @ResponseBody
    @RequiresPermissions("分配权限")
    public List<Permission> query(){
        return permissionDao.findAll();
    }

}
